Skip to content

Conversation

@ilevkivskyi
Copy link
Member

Currently:

x: object
y: Optional[int]
x = y
reveal_type(x) # builtins.int

this is unexpected and may be unsafe. This PR fixes this by considering object as overlapping with everything (including None).

Copy link
Collaborator

@JukkaL JukkaL left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks for the fix!

@JukkaL JukkaL merged commit 23b71df into python:master Oct 26, 2017
JukkaL pushed a commit that referenced this pull request Oct 31, 2017
Previously:

```
x: object
y: Optional[int]
x = y
reveal_type(x) # builtins.int
```

This was unexpected and may be unsafe. Fix this by considering object 
as overlapping with everything (including None).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants